<?php

namespace App\Http\Requests\Landscaping;

use Illuminate\Foundation\Http\FormRequest;
use App\Http\Requests\BaseRequest;

class ParkPestRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'pest_name' => 'required',
            'pest_keyword' => 'required',
            'pest_content' => 'required',
            'upload_id' => 'required|integer',
            'attached_page' => 'required|integer',
            'pest_user' => 'required'
        ];
    }

    public function messages() 
    {
        return [
            'pest_name.required' => '库名不能为空',
            'pest_keyword.required' => '关键词不能为空',
            'pest_content.required' => '内容不能为空',
            'upload_id.required' => '上传人不能为空',
            'upload_id.integer' => '上传人只能填写数字',
            'attached_page.required' => '附件页数不能为空',
            'attached_page.integer' => '附件页数只能填写数字',
            'pest_user.required' => '适用人群不能为空'
        ];
    }

}
